﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Maticsoft.Web
{
    public partial class s : System.Web.UI.Page
    {
        string key = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            key = Request.QueryString["key"];

            if (!IsPostBack)
            {
                BindData();
            }
        }

        protected void BindData()
        {
            BLL.Products proBLL = new BLL.Products();
            string strWhere = "ProductName like '%" + key + "%' and IsHid=0 and IsActive=1";
            string strOrder = "ProductId desc";
            int recordCount = proBLL.GetRecordCount(strWhere);
            AspNetPager1.RecordCount = recordCount;
            DataSet ds = proBLL.GetListByPage(strWhere, strOrder, AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
            Repeater1.DataSource = ds.Tables[0].DefaultView;
            Repeater1.DataBind();
        }

        protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
            BindData();
        }
    }
}